package com.cmnit.analysis

import com.cmnit.analysis.application.{AllApplication, DayTollClearingApplication, NsattleMentSumApplication}
import org.apache.log4j.Logger

object App {
  val logger: Logger = Logger.getLogger(this.getClass)

  def main(args: Array[String]): Unit = {

    // 参数一：程序名
    // 参数二：账期时间（日期格式：yyyyMMdd/yyyyMMddHH）
    var appName = ""
    var acctTime = ""
    if (args.length == 1) {
      appName = args(0)
    }
    if (args.length == 2) {
      appName = args(0)
      acctTime = args(1)
    }

    logger.info("开始加工数据")
    appName match {
      // 日清分结果表
      case "DayTollClearing" => DayTollClearingApplication.run(acctTime)
      // 资金结算汇总表
      case "NsattleMentSum" => NsattleMentSumApplication.run(acctTime)

      // 运行全部流程
      case _ => AllApplication.run(acctTime)
    }
  }
}
